import request from '@/router/axios';
import {
    formateTime
} from '../util/date';
export const list = (data) => request({
    url: '/admin/goods/list',
    method: 'post',
    data
}).then(data => {
    return data || [];
});
export const create = (data) => request({
    url: '/admin/goods/add',
    method: "post",
    data
});
export const update = (data) => request({
    url: '/admin/goods/modify',
    method: "post",
    data
});
export const remove = (id) => request({
    url: '/admin/goods/delete',
    method: "post",
    data: {
        id
    }
});
export const del = (id) => request({
    url: '/admin/goods/delete',
    method: "post",
    data
});

export function checkRealAuth(params) {
    return request.post('/admin/goods/check', params);
}

export function detail(id) {
    return request.post('/admin/goods/detail', { id })
}

export function setOnline(id) {
    return request.post('/admin/goods/modify_online_status', { id, status: 1 });
}

export function setOffline(id) {
    return request.post('/admin/goods/modify_online_status', { id, status: 0 });
}
export function modifyPublicShow({ id, showFlag }) {
    return request.post('/admin/goods/set_public_show', { id, showFlag });
}
